<?php
declare (strict_types=1);

namespace app\admin\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
//        "code"        => "require|alphaNum|length:3,10",
        "parent_code" => "require",
        "place_code" => "require",
        "nickname"    => "require",
        "mobile"      => "require|mobile",
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
//        'code.require'        => '请填写会员编号',
//        'code.alphaNum'       => '会员编号只能是3-10位字母或数字组合',
//        'code.length'         => '会员编号只能是3-10位字母或数字组合',
        'parent_code.require' => '请填写推荐人编号',
        'place_code.require' => '请填写接点人编号',
        'nickname.require'    => '请填写昵称',
        'mobile.require'      => '请填写手机号',
        'mobile.mobile'       => '手机号格式错误',

    ];
}
